<?php


  include "./includes/config.inc.php";

           	$query = "SELECT siteurl,adminmail,sitename FROM PHPAUCTIONXL_settings";
	$res = @mysql_query($query);
	if(!$res)
	{
		print "Error: $query<BR>".mysql_error();
		exit;
	}
	elseif(mysql_num_rows($res) > 0)
	{
		$SETTINGS = mysql_fetch_array($res);
	}


$update = $_POST['update'];


if ($update){
    $name = $_POST['name'];
// Contact subject

$subject = "Customer Service - ";
  $subject .= $_POST['subject']; 
// Details
$message=$_POST['detail']; 
// Mail of sender
  $mail_from=$_POST['customer_mail']; 
// From 
  $header="from:
  $name <$mail_from>"; 
// Enter your email address
  $to = $SETTINGS['adminmail']; 
mail($to,$subject,$message,$header);



// Check, if  message sent to your email 



           require("header.php");
 require("themes/default/template_contact_uss_php.html");
  require("footer.php");



}


else {

 require("header.php");
 require("themes/default/template_contact_us_php.html");
  require("footer.php");

      }








?>
